package com.jsh.erp.feign.system;

import com.jsh.erp.datasource.entities.DepotHead;
import com.jsh.erp.datasource.entities.User;
import org.apache.ibatis.annotations.Param;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.math.BigDecimal;
import java.util.List;

@FeignClient(name = "jsh-system", path = "/jshERP-boot/remote/api/depotHead", contextId = "DepotHeadRemoteClient")
public interface DepotHeadRemoteClient {
    // 单个账户的金额求和-入库和出库
    @GetMapping("/getAccountSum")
    BigDecimal getAccountSum(@RequestParam("id") Long id,
                             @RequestParam("timeStr") String timeStr,
                             @RequestParam("type") String type);

    // 单个账户的金额求和-多账户的明细合计
    @GetMapping("/getManyAccountSum")
    BigDecimal getManyAccountSum(@RequestParam("id") Long id,
                                 @RequestParam("timeStr") String timeStr,
                                 @RequestParam("type") String type);

    // 校验单据主表
    @GetMapping("/getDepotHeadListByAccountIds")
    List<DepotHead> getDepotHeadListByAccountIds(@RequestParam("accountIds") String[] accountIds);

    @GetMapping("/getDepotHead")
    DepotHead getDepotHead(@RequestParam("number") String number) throws Exception;
}
